Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: C#: Lotus Notes Automation Classes - Button click
Feedback Type: Question
Product Area: Notes Client
Technical Area: User Interface
Platform: Windows
Release: 8.5.1
Reproducible: Always

Hello,

Our company is using Lotus Notes DB for processing requests in manual way.

I'm planning to automatize this process by creating C# application that will automatically handle requests.

Each request is separate document in LotusNotes DB. Requests can be in multiple statuses(for example when created it's in Open, when it's confirmed then it's Confirmed).

When it's done in manual way user is opening DB, going to specific view and will open document. Inside document(actually above) there is button called EDIT, when user clicks on it page switch itself into EDIT mode.
In edit mode user can see button called Action. When this action is pressed context menu appears and there are several possibility and one of them is Confirm. When button Confirm is clicked then Lotus Script is executed and will edit several items on page and then save it.

I wrote C# application, but I'm not able to figure out how can ask Lotus Notes to press that button and then select Confirm button. I want to avoid sending keystrokes to application.

Code:
...
using lotus;
using System.Reflection;
...

Type NotesSession = Type.GetTypeFromProgID("Notes.NotesSession");
Type NotesUIWorkspace = Type.GetTypeFromProgID("Notes.NotesUIWorkspace");
Object sess = Activator.CreateInstance(NotesSession);
Object ws = Activator.CreateInstance(NotesUIWorkspace);

NotesUIWorkspace.InvokeMember("OpenDatabase", BindingFlags.InvokeMethod, null, ws, new Object[] { "server", "dir\\requests.nsf", "REQUESTS\\Open" });
Object uidb = NotesUIWorkspace.InvokeMember("GetCurrentDatabase", BindingFlags.InvokeMethod, null, ws, null);

Object db = NotesUIWorkspace.InvokeMember("Database", BindingFlags.GetProperty, null, uidb, null);
Type NotesDatabase = db.GetType();

Type NotesView = Type.GetTypeFromProgID("Notes.NotesView");
Object view = NotesUIWorkspace.InvokeMember("GetView", BindingFlags.InvokeMethod, null, db, new Object[] {"REQUESTS\\Open"} );

Object Document = NotesUIWorkspace.InvokeMember("GetFirstDocument", BindingFlags.InvokeMethod, null, view, new Object[] { });
Object DocumentUI = NotesUIWorkspace.InvokeMember("EditDocument", BindingFlags.InvokeMethod, null, ws, new Object[] { true, Document });


At the end of this code I have in LotusNotes opened document that I want to edit, but I don't know how to ask C# to push that button. Alternative way is to not push button, but going to: Actions(in Maiu of Main Lotus Notes window) -> Action -> Confirm .

Thank you for any help.


Feedback number WEBB8RXHQC created by ~Laura Rejumisterakoi on 02/29/2012

Status: Open
Comments:





Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS